﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime;
using System.Runtime.Remoting;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.IO;
using System.ComponentModel;
using System.Threading;

using PickGold.Handler;
using PickGold.Security;

namespace PickGold.Callers
{
	/// <summary/>
	public sealed class ActionToFunc<TResult> : C2AF<TResult>, I2AF<TResult>, IActionToFunc<TResult>
	{
		/// <summary/>
		public Action A;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.A;
			}
		}

		Delegate IActionToFunc<TResult>.A
		{
			get
			{
				return this.A;
			}
		}

		/// <summary/>
		public ActionToFunc(Action a, TResult r)
		{
			this.R = r;
			this.A = a;
		}

		/// <summary/>
		public ActionToFunc(HNoReturnDelegate a, TResult r)
		{
			this.R = r;
			this.A = new Action(a);
		}

		/// <summary/>
		public TResult F()
		{
			this.A();
			return this.R;
		}
	}

	/// <summary/>
	public sealed class ActionToFunc<T, TResult> : C2AF<TResult>, I2AF<TResult>, IActionToFunc<TResult>
	{
		/// <summary/>
		public Action<T> A;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.A;
			}
		}

		Delegate IActionToFunc<TResult>.A
		{
			get
			{
				return this.A;
			}
		}

		/// <summary/>
		public ActionToFunc(Action<T> a, TResult r)
		{
			this.R = r;
			this.A = a;
		}

		/// <summary/>
		public ActionToFunc(HNoReturnDelegate<T> a, TResult r)
		{
			this.R = r;
			this.A = new Action<T>(a);
		}

		/// <summary/>
		public TResult F(T arg)
		{
			this.A(arg);
			return this.R;
		}
	}

	/// <summary/>
	public sealed class ActionToFunc<T1, T2, TResult> : C2AF<TResult>, I2AF<TResult>, IActionToFunc<TResult>
	{
		/// <summary/>
		public Action<T1, T2> A;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.A;
			}
		}

		Delegate IActionToFunc<TResult>.A
		{
			get
			{
				return this.A;
			}
		}

		/// <summary/>
		public ActionToFunc(Action<T1, T2> a, TResult r)
		{
			this.R = r;
			this.A = a;
		}

		/// <summary/>
		public ActionToFunc(HNoReturnDelegate<T1, T2> a, TResult r)
		{
			this.R = r;
			this.A = new Action<T1,T2>(a);
		}

		/// <summary/>
		public TResult F(T1 arg1, T2 arg2)
		{
			this.A(arg1, arg2);
			return this.R;
		}
	}

	/// <summary/>
	public sealed class ActionToFunc<T1, T2, T3, TResult> : C2AF<TResult>, I2AF<TResult>, IActionToFunc<TResult>
	{
		/// <summary/>
		public Action<T1, T2, T3> A;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.A;
			}
		}

		Delegate IActionToFunc<TResult>.A
		{
			get
			{
				return this.A;
			}
		}

		/// <summary/>
		public ActionToFunc(Action<T1, T2, T3> a, TResult r)
		{
			this.R = r;
			this.A = a;
		}

		/// <summary/>
		public ActionToFunc(HNoReturnDelegate<T1, T2, T3> a, TResult r)
		{
			this.R = r;
			this.A = new Action<T1,T2,T3>(a);
		}

		/// <summary/>
		public TResult F(T1 arg1, T2 arg2, T3 arg3)
		{
			this.A(arg1, arg2, arg3);
			return this.R;
		}
	}

	/// <summary/>
	public sealed class ActionToFunc<T1, T2, T3, T4, TResult> : C2AF<TResult>, I2AF<TResult>, IActionToFunc<TResult>
	{
		/// <summary/>
		public Action<T1, T2, T3, T4> A;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.A;
			}
		}

		Delegate IActionToFunc<TResult>.A
		{
			get
			{
				return this.A;
			}
		}

		/// <summary/>
		public ActionToFunc(Action<T1, T2, T3, T4> a, TResult r)
		{
			this.R = r;
			this.A = a;
		}

		/// <summary/>
		public ActionToFunc(HNoReturnDelegate<T1, T2, T3, T4> a, TResult r)
		{
			this.R = r;
			this.A = new Action<T1,T2,T3,T4>(a);
		}

		/// <summary/>
		public TResult F(T1 arg1, T2 arg2, T3 arg3, T4 arg4)
		{
			this.A(arg1, arg2, arg3, arg4);
			return this.R;
		}
	}

	/// <summary/>
	public sealed class ActionToFunc<T1, T2, T3, T4, T5, TResult> : C2AF<TResult>, I2AF<TResult>, IActionToFunc<TResult>
	{
		/// <summary/>
		public Action<T1, T2, T3, T4, T5> A;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.A;
			}
		}

		Delegate IActionToFunc<TResult>.A
		{
			get
			{
				return this.A;
			}
		}

		/// <summary/>
		public ActionToFunc(Action<T1, T2, T3, T4, T5> a, TResult r)
		{
			this.R = r;
			this.A = a;
		}

		/// <summary/>
		public ActionToFunc(HNoReturnDelegate<T1, T2, T3, T4, T5> a, TResult r)
		{
			this.R = r;
			this.A = new Action<T1, T2, T3, T4, T5>(a);
		}

		/// <summary/>
		public TResult F(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
		{
			this.A(arg1, arg2, arg3, arg4, arg5);
			return this.R;
		}
	}

	/// <summary/>
	public sealed class ActionToFunc<T1, T2, T3, T4, T5, T6, TResult> : C2AF<TResult>, I2AF<TResult>, IActionToFunc<TResult>
	{
		/// <summary/>
		public Action<T1, T2, T3, T4, T5, T6> A;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.A;
			}
		}

		Delegate IActionToFunc<TResult>.A
		{
			get
			{
				return this.A;
			}
		}

		/// <summary/>
		public ActionToFunc(Action<T1, T2, T3, T4, T5, T6> a, TResult r)
		{
			this.R = r;
			this.A = a;
		}

		/// <summary/>
		public ActionToFunc(HNoReturnDelegate<T1, T2, T3, T4, T5, T6> a, TResult r)
		{
			this.R = r;
			this.A = new Action<T1,T2,T3,T4,T5,T6>(a);
		}

		/// <summary/>
		public TResult F(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
		{
			this.A(arg1, arg2, arg3, arg4, arg5, arg6);
			return this.R;
		}
	}

	/// <summary/>
	public sealed class ActionToFunc<T1, T2, T3, T4, T5, T6, T7, TResult> : C2AF<TResult>, I2AF<TResult>, IActionToFunc<TResult>
	{
		/// <summary/>
		public Action<T1, T2, T3, T4, T5, T6, T7> A;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.A;
			}
		}

		Delegate IActionToFunc<TResult>.A
		{
			get
			{
				return this.A;
			}
		}

		/// <summary/>
		public ActionToFunc(Action<T1, T2, T3, T4, T5, T6, T7> a, TResult r)
		{
			this.R = r;
			this.A = a;
		}

		/// <summary/>
		public ActionToFunc(HNoReturnDelegate<T1, T2, T3, T4, T5, T6, T7> a, TResult r)
		{
			this.R = r;
			this.A = new Action<T1,T2,T3,T4,T5,T6,T7>(a);
		}

		/// <summary/>
		public TResult F(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7)
		{
			this.A(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
			return this.R;
		}
	}

	/// <summary/>
	public sealed class ActionToFunc<T1, T2, T3, T4, T5, T6, T7, T8, TResult> : C2AF<TResult>, I2AF<TResult>, IActionToFunc<TResult>
	{
		/// <summary/>
		public Action<T1, T2, T3, T4, T5, T6, T7, T8> A;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.A;
			}
		}

		Delegate IActionToFunc<TResult>.A
		{
			get
			{
				return this.A;
			}
		}

		/// <summary/>
		public ActionToFunc(Action<T1, T2, T3, T4, T5, T6, T7, T8> a, TResult r)
		{
			this.R = r;
			this.A = a;
		}

		/// <summary/>
		public ActionToFunc(HNoReturnDelegate<T1, T2, T3, T4, T5, T6, T7, T8> a, TResult r)
		{
			this.R = r;
			this.A = new Action<T1,T2,T3,T4,T5,T6,T7,T8>(a);
		}

		/// <summary/>
		public TResult F(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8)
		{
			this.A(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
			return this.R;
		}
	}

	/// <summary/>
	public sealed class ActionToFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult> : C2AF<TResult>, I2AF<TResult>, IActionToFunc<TResult>
	{
		/// <summary/>
		public Action<T1, T2, T3, T4, T5, T6, T7, T8, T9> A;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.A;
			}
		}

		Delegate IActionToFunc<TResult>.A
		{
			get
			{
				return this.A;
			}
		}

		/// <summary/>
		public ActionToFunc(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9> a, TResult r)
		{
			this.R = r;
			this.A = a;
		}

		/// <summary/>
		public ActionToFunc(HNoReturnDelegate<T1, T2, T3, T4, T5, T6, T7, T8, T9> a, TResult r)
		{
			this.R = r;
			this.A = new Action<T1,T2,T3,T4,T5,T6,T7,T8,T9>(a);
		}

		/// <summary/>
		public TResult F(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9)
		{
			this.A(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
			return this.R;
		}
	}

	/// <summary/>
	public sealed class ActionToFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult> : C2AF<TResult>, I2AF<TResult>, IActionToFunc<TResult>
	{
		/// <summary/>
		public Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> A;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.A;
			}
		}

		Delegate IActionToFunc<TResult>.A
		{
			get
			{
				return this.A;
			}
		}

		/// <summary/>
		public ActionToFunc(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> a, TResult r)
		{
			this.R = r;
			this.A = a;
		}

		/// <summary/>
		public ActionToFunc(HNoReturnDelegate<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> a, TResult r)
		{
			this.R = r;
			this.A = new Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>(a);
		}

		/// <summary/>
		public TResult F(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10)
		{
			this.A(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
			return this.R;
		}
	}

	/// <summary/>
	public sealed class ActionToFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult> : C2AF<TResult>, I2AF<TResult>, IActionToFunc<TResult>
	{
		/// <summary/>
		public Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> A;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.A;
			}
		}

		Delegate IActionToFunc<TResult>.A
		{
			get
			{
				return this.A;
			}
		}

		/// <summary/>
		public ActionToFunc(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> a, TResult r)
		{
			this.R = r;
			this.A = a;
		}

		/// <summary/>
		public ActionToFunc(HNoReturnDelegate<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> a, TResult r)
		{
			this.R = r;
			this.A = new Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11>(a);
		}

		/// <summary/>
		public TResult F(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11)
		{
			this.A(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11);
			return this.R;
		}
	}

	/// <summary/>
	public sealed class ActionToFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult> : C2AF<TResult>, I2AF<TResult>, IActionToFunc<TResult>
	{
		/// <summary/>
		public Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> A;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.A;
			}
		}

		Delegate IActionToFunc<TResult>.A
		{
			get
			{
				return this.A;
			}
		}

		/// <summary/>
		public ActionToFunc(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> a, TResult r)
		{
			this.R = r;
			this.A = a;
		}

		/// <summary/>
		public ActionToFunc(HNoReturnDelegate<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> a, TResult r)
		{
			this.R = r;
			this.A = new Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12>(a);
		}

		/// <summary/>
		public TResult F(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12)
		{
			this.A(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
			return this.R;
		}
	}

	/// <summary/>
	public sealed class ActionToFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult> : C2AF<TResult>, I2AF<TResult>, IActionToFunc<TResult>
	{
		/// <summary/>
		public Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> A;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.A;
			}
		}

		Delegate IActionToFunc<TResult>.A
		{
			get
			{
				return this.A;
			}
		}

		/// <summary/>
		public ActionToFunc(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> a, TResult r)
		{
			this.R = r;
			this.A = a;
		}

		/// <summary/>
		public ActionToFunc(HNoReturnDelegate<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> a, TResult r)
		{
			this.R = r;
			this.A = new Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>(a);
		}

		/// <summary/>
		public TResult F(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13)
		{
			this.A(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13);
			return this.R;
		}
	}

	/// <summary/>
	public sealed class ActionToFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult> : C2AF<TResult>, I2AF<TResult>, IActionToFunc<TResult>
	{
		/// <summary/>
		public Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> A;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.A;
			}
		}

		Delegate IActionToFunc<TResult>.A
		{
			get
			{
				return this.A;
			}
		}

		/// <summary/>
		public ActionToFunc(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> a, TResult r)
		{
			this.R = r;
			this.A = a;
		}

		/// <summary/>
		public ActionToFunc(HNoReturnDelegate<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> a, TResult r)
		{
			this.R = r;
			this.A = new Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>(a);
		}

		/// <summary/>
		public TResult F(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14)
		{
			this.A(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14);
			return this.R;
		}
	}

	/// <summary/>
	public sealed class ActionToFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult> : C2AF<TResult>, I2AF<TResult>, IActionToFunc<TResult>
	{
		/// <summary/>
		public Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> A;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.A;
			}
		}
		Delegate IActionToFunc<TResult>.A
		{
			get
			{
				return this.A;
			}
		}

		/// <summary/>
		public ActionToFunc(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> a, TResult r)
		{
			this.R = r;
			this.A = a;
		}

		/// <summary/>
		public ActionToFunc(HNoReturnDelegate<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> a, TResult r)
		{
			this.R = r;
			this.A = new Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15>(a);
		}

		/// <summary/>
		public TResult F(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15)
		{
			this.A(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15);
			return this.R;
		}
	}

	/// <summary/>
	public sealed class ActionToFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult> : C2AF<TResult>, I2AF<TResult>, IActionToFunc<TResult>
	{
		/// <summary/>
		public Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> A;

		/// <summary/>
		protected internal override Delegate H
		{
			get
			{
				return this.A;
			}
		}

		Delegate IActionToFunc<TResult>.A
		{
			get
			{
				return this.A;
			}
		}

		/// <summary/>
		public ActionToFunc(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> a, TResult r)
		{
			this.R = r;
			this.A = a;
		}

		/// <summary/>
		public ActionToFunc(HNoReturnDelegate<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> a, TResult r)
		{
			this.R = r;
			this.A = new Action<T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16>(a);
		}

		/// <summary/>
		public TResult F(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16)
		{
			this.A(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16);
			return this.R;
		}
	}

	/// <summary/>
	public interface IActionToFunc<TResult> : I2AF<TResult>
	{
		/// <summary/>
		Delegate A { get; }
	}

	/// <summary/>
	public interface I2AF<TResult>
	{
		/// <summary/>
		object D { set; get; }
		/// <summary/>
		TResult R { set; get; }
		/// <summary/>
		Delegate H { get; }
	}

}
